package com.seb.cc.gtou.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageButton;

import com.seb.cc.gtou.utils.ActivityType;
import com.seb.cc.ttou.R;

public class GTou extends Activity {
	
	private ImageButton gtouSejour;
	private ImageButton gtouParticipants;
	private ImageButton gtouExport;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.gtou);
        
        gtouSejour = (ImageButton)findViewById(R.id.gtouSejour);
        gtouSejour.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				startActivity(new Intent(v.getContext(),GTouSejourListActivity.class));
				
			}
		});
        
        gtouParticipants =(ImageButton)findViewById(R.id.gtouParticipants);
        gtouParticipants.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				startActivity(new Intent(v.getContext(),GTouParticipantActivity.class));
				
			}
		});
        
        gtouExport = (ImageButton)findViewById(R.id.gtouExport);
        gtouExport.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				startActivity (new Intent(GTou.this, GTouExport2.class));
				
			}
		});
    }
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
	    MenuInflater inflater = getMenuInflater();
	    inflater.inflate(R.menu.gtoumainmenu, menu);
	    return true;
	}
	@Override
	public boolean onOptionsItemSelected (MenuItem item){
		// Handle item selection
	    switch (item.getItemId()) {
	    case R.id.mainPrefs:
	    	startActivity(new Intent(GTou.this,GTouPrefActivity.class));
	        return true;
	       //TODO implement other button
	    default:
	        return super.onOptionsItemSelected(item);
	    }
	}
}
